package tij4.concurrent.exercise.ex16;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Ex16 {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newCachedThreadPool();
        LockTest lockTest = new LockTest();
        LockTest1 lockTest1 = new LockTest1();
        executorService.execute(new Runnable() {
            @Override
            public void run() {
                lockTest.fun1();
            }
        });

        executorService.execute(new Runnable() {
            @Override
            public void run() {
                lockTest.fun2();
            }
        });

        executorService.execute(new Runnable() {
            @Override
            public void run() {
                lockTest.fun3();
            }
        });

        executorService.execute(new Runnable() {
            @Override
            public void run() {
                lockTest1.fun1();
            }
        });

        executorService.execute(new Runnable() {
            @Override
            public void run() {
                lockTest1.fun2();
            }
        });

        executorService.execute(new Runnable() {
            @Override
            public void run() {
                lockTest1.fun3();
            }
        });

    }
}
